use std::fs::File;
use std::io::Read;
use rjvm_class_file::byte_data_reader::ByteDataReader;
use rjvm_class_file::class_file::{ClassFile};

#[test]
fn class_file_test() {

    let result = File::open(r"C:\Code\rjvm\java-example\target\classes\org\example\model\TestModel.class");
    match result {
        Ok(mut file) => {
            let mut data: Vec<u8> = Vec::new();
            let _drop = file.read_to_end(&mut data);
            let mut reader = ByteDataReader::new(data);
            let cf_result = ClassFile::create(&mut reader);
            match cf_result {
                Ok(_cf) => {
                    println!("OK");
                }
                Err(err) => {
                    println!("{}", err);
                }
            };
        }
        Err(message) => {
            println!("{}", message)
        }
    }
}